//
//  ExpertModel.h
//  DaJiang
//
//  Created by sally on 16/10/12.
//  Copyright © 2016年 jiniu. All rights reserved.
//

#import "AccountInterface.h"
#import "BussinessModel.h"
#import "ExpertInterface.h"
#import "TopicModel.h"
#import "UserModel.H"

/**
 *  专家实体
 */
@protocol TopicModel
@end
@interface ExpertModel : BussinessModel

@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, assign) NSInteger expertid;
@property (nonatomic, strong) UserData *user_data;
@property (nonatomic, strong) NSMutableArray<TopicModel> *pro_topic;

//获取全部专家列表
+ (void)queryAllExpertListWithLocation:(NSString *)location
                                cursor:(NSInteger)cursor
                            completion:(void (^)(NSMutableArray *expertList))completion;

//一级分类目录下的全部专家
+ (void)queryLevel1AllExpertListWithLocation:(NSString *)location
                                    proIndex:(NSString *)proIndex
                                      cursor:(NSInteger)cursor
                                  completion:(void (^)(NSMutableArray *expertList))completion;

//二级分类目录下的所有专家
+ (void)queryLevel2AllExpertListWithLocation:(NSString *)location
                                    proIndex:(NSString *)proIndex
                                   proIndex2:(NSString *)proIndex2
                                      cursor:(NSInteger)cursor
                                  completion:(void (^)(NSMutableArray *expertList))completion;

//专家排序
+ (void)sortExpertListWithLocation:(NSString *)location
                          proIndex:(NSString *)proIndex
                         proIndex2:(NSString *)proIndex2
                              page:(NSInteger)page
                              type:(ExpertSort_Type)type
                        completion:(void (^)(NSMutableArray *expertList))completion;

//搜索
+ (void)searchExpertListWithLocation:(NSString *)location
                             content:(NSString *)content
                          completion:(void (^)(NSMutableArray *expertList))completion;

//约见是否开放
+ (void)setMeetAvailableWithAvailable:(NSInteger)available
                           completion:(void (^)(BOOL isSucceed))completion;

@end

/**
 *  推荐实体
 */
@class RecommendData;
@interface RecommendModel : BussinessModel

@property (nonatomic, assign) NSInteger to_uid;
@property (nonatomic, assign) NSInteger recommendid;
@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, strong) UserModel *pro_user_data;
@property (nonatomic, strong) NSString *op_name;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, strong) RecommendData *op_data;

//获取推荐专家列表(首页)
+ (void)queryRecommendListWithLocation:(NSString *)location
                                cursor:(NSInteger)cursor
                            completion:(void (^)(NSMutableArray *bannerList))completion;

@end

@interface RecommendData : BussinessModel

@property (nonatomic, strong) NSString *recommend_title;
@property (nonatomic, strong) NSString *recommend_pic;
@property (nonatomic, strong) NSString *user_location_name;
@property (nonatomic, assign) NSInteger like_count; //收藏（想见）的数量

@end

/**
 *  专家详情实体
 */
@protocol UserModel
@end
@protocol CommentModel
@end
@interface ExpertDetailModel : BussinessModel

@property (nonatomic, strong) NSMutableArray<CommentModel> *pro_topic_comments;
@property (nonatomic, strong) NSMutableArray<TopicModel> *pro_topic;
@property (nonatomic, strong) NSMutableArray<UserModel> *pro_user_info;

//专家详情
+ (void)queryExpertDetailWithProUid:(NSInteger)uid
                         completion:(void (^)(ExpertDetailModel *expertDetail))completion;

@end

/**
 *  评论实体
 */
@class CommentData;
@interface CommentModel : BussinessModel

@property (nonatomic, assign) NSInteger to_uid;
@property (nonatomic, assign) NSInteger commentid;
@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, strong) NSString *op_name;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, strong) CommentData *op_data;
@property (nonatomic, strong) UserModel *user;

//查看更多评论
+ (void)queryCommentListWithProUid:(NSInteger)proUid
                            cursor:(NSInteger)cursor
                        completion:(void (^)(NSMutableArray *commentList))completion;

@end

@interface CommentData : BussinessModel

@property (nonatomic, assign) NSInteger cmt_value;
@property (nonatomic, strong) NSString *pro_topic_name;
@property (nonatomic, strong) NSString *comment;

@end

/**
 *  收藏实体
 */
@class CollectData;
@interface CollectModel : BussinessModel

@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, assign) NSInteger collectid;
@property (nonatomic, strong) UserModel *pro_user;
@property (nonatomic, strong) NSMutableArray<TopicModel> *pro_topics;
@property (nonatomic, assign) NSInteger to_uid;
@property (nonatomic, strong) NSString *op_name;
@property (nonatomic, strong) CollectData *op_data;

//我的心愿单
+ (void)queryCollectListWithCursor:(NSInteger)cursor
                        completion:(void (^)(NSMutableArray *collectList))completion;

@end

@interface CollectData : BussinessModel

@property (nonatomic, strong) NSString *desc;
@property (nonatomic, strong) NSString *op_name;

@end

/**
 *  专家有空实体
 */
@class FreeData;
@interface FreeModel : BussinessModel

@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, assign) NSInteger freeid;
@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, strong) FreeData *data;

//专家有空列表
+ (void)queryFreeListWithCompletion:(void (^)(NSMutableArray *freeList))completion;

//添加有空
+ (void)addFreeWithTime:(NSString *)time
               location:(NSString *)location
             completion:(void (^)(FreeModel *freeModel))completion;

//专家可约的有空列表
+ (void)queryExpertFreeListWithProUid:(NSInteger)proUid
                           completion:(void (^)(NSMutableArray *freeList))completion;

@end

@interface FreeData : BussinessModel

@property (nonatomic, assign) NSInteger state;      //0=空闲；1=进行中，待定；2=进行中，有约；3=结束
@property (nonatomic, strong) NSString *state_desc; //状态描述，app转换
@property (nonatomic, strong) NSString *location;
@property (nonatomic, strong) NSString *time; //时间应该传文本过来，而不是秒数

@end

/**
 *  成为专家实体
 */
@interface BecomeExpertModel : BussinessModel

@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, strong) NSString *education;
@property (nonatomic, strong) NSString *loc;
@property (nonatomic, strong) NSString *witness;
@property (nonatomic, strong) NSString *idCardPic;
@property (nonatomic, strong) NSString *qualificationFile;
@property (nonatomic, strong) NSString *selfDesc;
@property (nonatomic, strong) NSString *userName;
@property (nonatomic, strong) NSString *company;
@property (nonatomic, strong) NSString *userTitle;
@property (nonatomic, strong) NSString *experience;
@property (nonatomic, strong) NSString *topicName;
@property (nonatomic, strong) NSString *timeLength;
@property (nonatomic, strong) NSString *topicDesc;
@property (nonatomic, assign) CGFloat topicPrice;
@property (nonatomic, strong) NSString *bgPic;
@property (nonatomic, strong) NSString *topicIndex;
@property (nonatomic, strong) NSString *topicIndex2;
@property (nonatomic, strong) NSString *userEmail;

//初始化
- (instancetype)initWithNull;

//申请成为专家
+ (void)applyExpertWithModel:(BecomeExpertModel *)becomeExpertModel
                  completion:(void (^)(BOOL isSucceed))completion;

@end

/**
 *  申请状态实体
 */
@class ApplyStatusData;
@interface ApplyStatusModel : BussinessModel

@property (nonatomic, assign) NSInteger created_at;
@property (nonatomic, assign) NSInteger updated_at;
@property (nonatomic, strong) NSString *statusid;
@property (nonatomic, strong) ApplyStatusData *data;

//查询申请状态
+ (void)queryApplyStatusWithCompletion:(void (^)(ApplyStatusModel *applyStatusModel))completion;

@end

@interface ApplyStatusData : BussinessModel

@property (nonatomic, assign) NSInteger application_state; //申请状态（0=申请中，1=通过，2=拒绝）
@property (nonatomic, strong) NSString *reject_reason;     //拒绝理由（只有application_statestring=2时才存在）

@end
